import request from '@/utils/request'
// 获取-员工列表
export const getUserListRequest = (params) => {
  return request.get('/sys/user', { params })
}
// 删除员工
export const deleteEmployeeRequest = (id) => {
  return request.delete(`/sys/user/${id}`)
}
// 获取员工基本信息
export const getEmployeeRequest = (id) => {
  return request.get(`/sys/user/${id}`)
}
// 新增员工
export const addEmployeeRequest = (data) => {
  return request.post(`/sys/user`, data)
}
// 修改员工基本信息
export const updateEmployeeRequest = (data) => {
  return request.put(`/sys/user/${data.id}`, data)
}

// 导出excel
export const exportExcelRequest = () => {
  return request({
    url: '/sys/user/export',
    method: 'GET',
    responseType: 'blob'
  })
}
// 下载导入模板
export const exportTemplateRequest = () => {
  return request({
    url: '/sys/user/import/template',
    method: 'GET',
    responseType: 'blob'
  })
}
// 上传excel
export const importExcelRequest = (file) => {
  return request({
    url: '/sys/user/import',
    method: 'POST',
    data: file
  })
}
